<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/views/global/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath %>">
<%@include file="/views/global/ShopInclude.jsp" %>
<link href="static/css/page/ProductEdit.css" rel="stylesheet" type="text/css">
<link href="static/css/page/submitProject.css" rel="stylesheet" type="text/css">
<title>EDIT PROJECT</title>
</head>
<body class="submitBg">
 <%@include file="/views/global/header.jsp" %>
 <c:set var="pageName" value="projectEdit"></c:set>
  <%@include file="/views/global/SellerHeader.jsp" %>

  <div class="submit-form submitFormContainer center font fontColorGray">  <!-- 表单填写部分 -->
    <div class="submitFormTitle">RELEASE YOUR PROJECT HERE !</div>
    <hr class="hrBorder">
    <form id="submitForm" class="" action="" method="post">
      <input type="hidden" name="id" value="${project.id }"/>
      <input type="hidden" id="fileId" name="fileId" value="${project.fileId }"/>
      <table>
        <tr class="projectCategoryLine hrTableThin">
          <td class="projectformLabel left" style="padding-top: 4px;">CATEGORY:<p class="hrTableBorder" style="width:1152px;height: 9px;"></p></td>
          <td class="dropdown-group">
          	<input type="text" name="category" class="dropdownInput dropdownWider" value="${project.category }" readonly />
          	<img class="formDropdownArrow" src="static/images/global/formArrow.png"/>
            <ul class="dropdownOptions">
             <c:forEach var="item"  items="${projectCategoryList }">
              <li><div class="leaf" value="${item.id }">${item.dictValue }</div></li>
             </c:forEach>
            </ul>
          </td>
        </tr>
        
        <tr class="projectDescriptionTitleLine">
          <td colspan="2" class="projectformLabel">DESCRIPTION<p class="hrTableBorder" style="width:1152px;margin-top: 10px;"></p></td>          
        </tr>
        
         <tr class="projectPosterLine">
          <td class="projectformLabel left">UPLOAD POSTER:</td>
          <td class="row">
            <div class="addProjectImageArea col-xs-3">
              <input id="addProjectImageFile" name="addProjectImage" class="addProjectImage" type="file" accept="img/*"/>
              <img class="addProjectImageIcon" src="static/images/page/submitCommodity/photoAddIcon.png"/>
            </div>
            <ul class="projectImageAdded col-xs-9">
                <c:if test="${not empty project.fileId }">
                	<li class="addedProjectImage"><img width='270px' height='270px' src="${fileServerBasePath }download/${project.fileId  }"/><div class="projectImgDeleteIcon" onclick='deleteImage()'></div></li>
                </c:if>
            </ul>
          </td>
        </tr>
        
        <tr class="projectDescriptionLine">
          <td class="projectformLabel left">DESCRIPTION:</td>
          <td>
            <textarea name="description"  class="projectDescriptionInput"/>${project.description }</textarea>
            <div class="descriptionReminder">SAVE EVERY 5 MINUTES.
            <!-- <span><input type="button" name="projectDescriptionSaveBtn" class="projectDescriptionSaveBtn right" value="SAVED"/></span> -->
            </div>
            
          </td>
        </tr>
        <tr><td colspan="2"><p class="hrTableBorder" style="width:1152px;margin: 60px 0 0 0px;"></p></td></tr>
      </table>
     <div class="form-group row">
    	<div class="col-xs-2">
    		<button type="button" class="btn btn-default" onclick="" style="border-radius: 0;width: 100px; height: 40px; color: #fff; background: #b5b6b3; margin: 50px 0 80px 250px;">EXIT</button>
    	</div>
    	<div class="col-xs-8">
    		<div id="msg"></div>
    	</div>
    	<div class="col-xs-2">
    		<button type="button" class="btn btn-default pull-right" id="projectSubmit" style="border-radius: 0;width: 100px; height: 40px; color: #fff; background: #47caf4; margin: 50px 250px 80px 0;">POST</button>
    	</div>
    </div>
    <div class="form-group row">
    	<div class="col-xs-5"></div>
    	<div class="col-xs-7">
    		<input type="button" name="preview" class="previewBtn center-block" value="PREVIEW"/>
    	</div>
    </div>
    </form>
  </div>
  
<%@include file="/views/global/AdminScripts.jsp" %>
<%@include file="/views/global/footer.jsp" %>

 <script type="text/javascript" src="static/javascript/module/generic.js"></script>
 <script type="text/javascript" src="static/javascript/page/project/ProjectEdit.js"></script>
 <script type="text/javascript">
$(document).ready(function(){
	$("#projectSubmit").click(function () {
		$("#submitForm").goAjax({semantic: false, checkLogin: false,
			url: "seller/project/save",
			data:{},
			success: function(jsonData) {
				if(true == jsonData.success){
					$("#msg").alert({type:'alert-success', text: jsonData.message});
       			} else {
       				$("#msg").alert({type:'alert-danger', text: jsonData.message});
       			}
			}
		});
    });
});

</script>
</body>
</html>